<?php

use App\Models\Article\ArticleCategoryModel;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AlterTableArticleCategoryAddPutTop extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('article_category', function (Blueprint $table) {
            $table->unsignedTinyInteger('putTop')->default(0)->after('sort')
                  ->comment(enumToMigrationComment(ArticleCategoryModel::PUT_TOP_TEXT, "是否置顶"));
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('article_category', function (Blueprint $table) {
            $table->dropColumn('putTop');
        });
    }
}
